package com.example.demo1.controller;

import com.example.demo1.pojo.po.User;
import com.example.demo1.service.TokenService;
import com.example.demo1.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: 本类用于
 * Created by 白相宇 on 2019/12/26 11:25
 */
@RestController
public class TokenController {
    @Autowired
    private TokenService tokenService;

    @GetMapping("/token")
    public ResultUtil saveToken(){
        User user=new User();
        user.setUserCode("123456@qq.com");
        user.setId(5);
        String s=tokenService.generationToken("",user);
        tokenService.saveToken("wang",s);
        return ResultUtil.success();
    }

}
